<template>
  <div ref="fushi">
    <Jujia>
      <template v-slot:jujiantitle>
        {{ shangpinqujiann.name }}
      </template>
      <template v-slot:jujiaullist>
        <ul>
          <li v-for="item in shangpinqujiann.children" :key="item.id">
            {{ item.name }}
          </li>
        </ul>
        <p style="color: gray">查看全部></p>
      </template>
      <template>
        <div class="jujiaindedxdivyi">
          <img
            src="https://yjy-oss-files.oss-cn-zhangjiakou.aliyuncs.com/tuxian/home_goods_cover.jpg"
          />
        </div>
        <div class="jujiaindexdiver">
          <ul class="jujiaindexdivul">
            <li
              class="jujiaindexdivli"
              v-for="it in shangpinqujiann.goods"
              :key="it.id"
            >
              <img src="" alt="" v-lazy="it.picture" />
              <p class="shangpinyiyou">{{ it.desc }}</p>
              <p class="shangpinyichu">{{ it.name }}</p>
              <p class="jujiaindexdivlip">
                <span>￥</span><span>{{ it.price }}</span>
              </p>
              <div class="extra">
                <RouterLink to="/">
                  <span>找相似</span>
                  <span>发现现多宝贝 &gt;</span>
                </RouterLink>
              </div>
            </li>
          </ul>
        </div>
      </template>
    </Jujia>
  </div>
</template>
  <script>
import { lazyload } from "@/utils/constfun";
import Jujia from "@/components/soltview/jujia.vue";
import { getchangpinapi } from "@/utils/api/headerapi";
export default {
  data() {
    return {
      shangpinqujiann: {},
    };
  },
  methods: {
    async Getchanpinn() {
      let res = await getchangpinapi();
      // console.log(res);
      this.shangpinqujiann = res.result[2];
    },
  },
  mounted() {
    // this.Getchanpinn();
    lazyload(this.$refs.fushi, this.Getchanpinn);
  },
  components: { Jujia },
};
</script>